Skip to content

Modularize cleartext specifications for the bitcoin app#267

Merged
bigspider merged 2 commits into
masterfrom
cleartext-multilang
May 20, 2026
Merged

Modularize cleartext specifications for the bitcoin app#267
bigspider merged 2 commits into
masterfrom
cleartext-multilang

Conversation

@bigspider
Copy link
Copy Markdown
Contributor

@bigspider bigspider commented May 19, 2026

Move bip388/cleartext into standalone crate.
Move both the specs and the test vectors in a a folder containing toml files.

@bigspider bigspider requested a review from a team as a code owner May 19, 2026 13:44
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR extracts the BIP388 cleartext display/specification logic from the Bitcoin common crate into a new standalone apps/bitcoin/bip388 crate, and migrates the cleartext specification + test vectors into TOML files to be consumed by codegen and tests.

Changes:

  • Introduces a new bip388 crate containing the BIP388 parsing/types plus cleartext encode/decode support and code generation via build.rs.
  • Moves the cleartext specification and test vectors into src/cleartext/specs/*.toml and updates the codegen/test harness to consume them.
  • Updates the Bitcoin common crate to depend on and re-export the new bip388 crate; updates CI and workspace configuration to include the new crate.

Reviewed changes

Copilot reviewed 11 out of 13 changed files in this pull request and generated no comments.

Show a summary per file
File Description
vanadium.code-workspace Adds the new apps/bitcoin/bip388 folder to the workspace config.
apps/bitcoin/common/src/lib.rs Switches from an internal bip388 module to re-exporting the external bip388 crate.
apps/bitcoin/common/src/bip388/cleartext/mod.rs Removes the old in-crate cleartext implementation (moved to the new crate).
apps/bitcoin/common/Cargo.toml Drops cleartext codegen build deps and adds a path dependency on ../bip388.
apps/bitcoin/bip388/Cargo.toml Adds the new bip388 crate manifest, features, and build/dev dependencies.
apps/bitcoin/bip388/build.rs Implements cleartext code generation from src/cleartext/specs/cleartext.toml.
apps/bitcoin/bip388/src/lib.rs Defines the new crate root, wiring in cleartext/time and re-exporting cleartext API.
apps/bitcoin/bip388/src/time.rs Adds time/date formatting + parsing helpers used by cleartext.
apps/bitcoin/bip388/src/cleartext/mod.rs Adds the cleartext encode/decode + confusion score logic and TOML-driven test harness.
apps/bitcoin/bip388/src/cleartext/decode.rs Updates decode module comment to reference the new spec path.
apps/bitcoin/bip388/src/cleartext/specs/cleartext.toml Adds the TOML “single source of truth” cleartext spec consumed by codegen.
apps/bitcoin/bip388/src/cleartext/specs/test_vectors.toml Adds shared TOML test vectors for encoder/decoder behavior.
.github/workflows/ci.yaml Ensures native tests run in the new apps/bitcoin/bip388 directory.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@bigspider bigspider merged commit 3b6d6e4 into master May 20, 2026
148 of 149 checks passed
@bigspider bigspider deleted the cleartext-multilang branch May 20, 2026 09:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants